home *** CD-ROM | disk | FTP | other *** search
/ SIGGRAPH 2002 Course Notes / SIGGRAPH 2002 - Course Notes - Disc 1.iso / pc / notes / 16 / supplemental-material / Gritz / expense2.sl < prev   
Encoding:
Text File  |  2002-04-05  |  455 b   |  19 lines

  1. #include "bake.h"
  2.  
  3. surface expensive2 (float Ka = 1, Kd = 0.5, Ks = 0.5, roughness = 0.1;
  4.             color specularcolor = 1;
  5.             string bakename = "bake")
  6. {
  7.     color myfunc (float s, t) {
  8.     return color noise (s, t);
  9.     }
  10.  
  11.     color Ct;
  12.     BAKE (bakename, s, t, myfunc, Ct);
  13.  
  14.     normal Nf = faceforward (normalize(N),I);
  15.     Ci = Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
  16.      specularcolor * Ks*specular(Nf,-normalize(I),roughness);
  17.     Oi = Os;  Ci *= Oi;
  18. }
  19.